import request from "@/config/axios";

// AI 音乐 API
export const MusicApi = {
  // 查询音乐分页
  getMusicPage: async (params) => {
    return await request.get({ url: `/ai/music/my-page`, params });
  },

  // 查询音乐状态
  refreshMusicStatus: async (ids) => {
    return await request.get({
      url: `/ai/music/my-list-by-ids`,
      params: { ids: ids.join(",") },
    });
  },

  // 音乐生成
  createMusic: async (data) => {
    return await request.post({ url: `/ai/music/generate`, data });
  },

  // 音乐生成
  createLyrics: async (data) => {
    return await request.post({ url: `/ai/music-lyrics/generate`, data });
  },

  // 音乐算力
  lyricsPower: async (data) => {
    return await request.post({ url: `/ai/music-lyrics/power`, data });
  },

  // 更新音乐
  updateMusic: async (data) => {
    return await request.put({ url: "/ai/music/update", data });
  },

  // 删除音乐
  deleteMusic: async (id) => {
    return await request.delete({ url: `/ai/music/delete-my?id=` + id });
  },
};
